package cn.lucky.se.example;

import cn.lucky.se.entity.Person;
import cn.lucky.se.entity.Students;

/**
 * @Author:蒋凌鹏
 * @Date:2020/9/15
 * @Explain:javaseries
 */
public class JavaObject {

    public static void main(String[] args) {

        Person person = new Person();
        Person stu = new Students();

        /**
         * instanceof 关键字：表示对象是否为该类的实例
         */
        if (person instanceof  Students){
            System.out.println("person对象是Students类的实例");
        }else{
            System.out.println("person对象不是是Students类的实例");
        }

        if(stu == person){
            System.out.println("stu和person相等");
        }else{
            System.out.println("stu和person不相等");
        }



    }

}
